/****************************************************/
// Theme name: Nexus - Bootstrap Admin Template
// Theme URI: http://nexus.lethemes.net/1.0/html/
// Description: Nexus is a fully responsive admin dashboard template
// Tags: admin, admin dashboard, cms, crm, project managerment, responsive, webapp, backend, bootstrap admin, responsive admin
// Author: Loi Le
// Version: 1.0
/****************************************************/

// Bootstrap Dual Listbox
// --------------------------------------------------
$("#listboxForm").submit(function() {
    alert($('.dual-listbox').val());
    return false;
});

// Date Range Picker for Bootstrap
// --------------------------------------------------
$('#daterangepicker').daterangepicker({
    ranges: {
        'Today': [moment(), moment()],
        'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
        'Last 7 Days': [moment().subtract('days', 6), moment()],
        'Last 30 Days': [moment().subtract('days', 29), moment()],
        'This Month': [moment().startOf('month'), moment().endOf('month')],
        'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
    },
    opens: 'left',
    startDate: moment().subtract(29, 'days'),
    endDate: moment(),
}, function(start, end, label) {
    $('#daterangepicker span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
});
$('#daterangepicker span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));

// Geocomplete
// --------------------------------------------------
$("#geocomplete").geocomplete({
    map: ".map_canvas",
    details: ".attribute",
    detailsAttribute: "data-geo",
    location: "NYC"
});